#ifndef IDEFAULTENTITYBEHAVIOUR_H
#define IDEFAULTENTITYBEHAVIOUR_H

#include "../include/constantes.h"
#include <sstream>

//**************************
//Manage the behaviour of an entity
//**************************
class IDefaultEntityBehaviour
{
    protected:
        int m_iX;	//Abscissa position of the entity (the center of the entity)

        int m_iY;	//Ordinary position of the entity (the center of the entity)

        int m_iSpeedX;	//Speed of the entity on the abscissa

        int m_iSpeedY;	//Speed of the entity on the ordinary

        int m_iWidth;  //Width of the entity

        int m_iHeight;  //Height of the entity

        float m_fCollisionBoxRatioWidth;   //Ratio of the width of the collision box

        float m_fCollisionBoxRatioHeight;   //Ratio of the height of the collision box

        TYPE_COLLISION m_iTypeCollision;   //AIR or LAND


    public:
        //**************************
        //Description : Constructor
        //Parameters : Value for m_iX, m_iY,
        //              m_iSpeedX, m_iSpeedY,
        //              m_iWidth, m_Height,
        //              the ratio for the collision box
        //              and the type of collision
        //Note : None
        //**************************
        IDefaultEntityBehaviour(int _iX = 0, int _iY = 0,
                                int _iSpeedX = 1, int _iSpeedY = 1,
                                int _iWidth = 0, int _iHeight = 0,
                                float _fRatioW = 0.0f, float _fRatioH = 0.0f,
                                TYPE_COLLISION _iTypeCollision = AIR);

        //**************************
        //Description : Copy Constructor
        //Parameters : A IDefaultEntityBehaviour
        //Note : None
        //**************************
        IDefaultEntityBehaviour(IDefaultEntityBehaviour & _DefaultEntityBehaviour);

        //**************************
        //Description : Destructor
        //Parameters : None
        //Note : None
        //**************************
        virtual ~IDefaultEntityBehaviour();

        //**************************
        //Description : Test if the entity is in collision with _Entity
        //Parameters : None
        //Return Value : true if there is collision, otherwise false
        //Note : Collision can be different for entity (for example a bomb don't collide all the time, because it's in the air)
        //**************************
        virtual bool CollideWith(IDefaultEntityBehaviour * _Entity) const;

        //**************************
        //Description : Return the type of collision of the entity
        //Parameters : None
        //Return Value : The type of collision
        //Note : None
        //**************************
        int GetTypeCollision() const;

        //**************************
        //Description : Return the abscissa position of the entity
        //Parameters : None
        //Return Value : the abscissa position
        //Note : None
        //**************************
        int GetX() const;

        //**************************
        //Description : Return the ordinary position of the entity
        //Parameters : None
        //Return Value : the ordinary position
        //Note : None
        //**************************
        int GetY() const;

        //**************************
        //Description : Return the position of the entity
        //Parameters : References on the abscissa and the ordinary position
        //Return Value : None
        //Note : None
        //**************************
        void GetPosition(int & _iX, int & _iY) const;

        //**************************
        //Description : Set, if possible, the position of the entity on the abscissa
        //Parameters : New value of m_iX
        //Return Value : None
        //Note : None
        //**************************
        void SetX(int _iX);

        //**************************
        //Description : Set, if possible, the position of the entity on the ordinary
        //Parameters : New value of m_iY
        //Return Value : None
        //Note : None
        //**************************
        void SetY(int _iY);

        //**************************
        //Description : Add, if possible, a value on the abscissa
        //Parameters : Add value for m_iX
        //Return Value : None
        //Note : None
        //**************************
        void AddX(int _iValue);

        //**************************
        //Description : Add, if possible, the position of the entity on the ordinary
        //Parameters : Add value for m_iY
        //Return Value : None
        //Note : None
        //**************************
        void AddY(int _iValue);

        //**************************
        //Description : Set, if possible, the position of the entity
        //Parameters : New values of m_iX and m_iY
        //Return Value : None
        //Note : None
        //**************************
        void SetPosition(int _iX, int _iY);

        //**************************
        //Description : Set the width of the entity
        //Parameters : The new width
        //Return Value : None
        //Note : None
        //**************************
        void SetWidth(int _iNewWidth);

        //**************************
        //Description : set the height of the entity
        //Parameters : The new height
        //Return Value : None
        //Note : None
        //**************************
        void SetHeight(int _iNewHeight);

        //**************************
        //Description : Return the width of the entity
        //Parameters : None
        //Return Value : the width
        //Note : None
        //**************************
        int GetWidth() const;

        //**************************
        //Description : Return the height of the entity
        //Parameters : None
        //Return Value : the height
        //Note : None
        //**************************
        int GetHeight() const;

        //**************************
        //Description : Return the ratio width of the entity
        //Parameters : None
        //Return Value : the ratio width
        //Note : None
        //**************************
        float GetRatioWidth() const;

        //**************************
        //Description : Return the ratio height of the entity
        //Parameters : None
        //Return Value : the ratio height
        //Note : None
        //**************************
        float GetRatioHeight() const;

        //**************************
        //Description : Return the speed on the abscissa of the entity
        //Parameters : None
        //Return Value : the aspeed on the abscissa position
        //Note : None
        //**************************
        int GetSpeedX() const;

        //**************************
        //Description : Return the speed on the ordinary of the entity
        //Parameters : None
        //Return Value : the aspeed on the ordinary position
        //Note : None
        //**************************
        int GetSpeedY() const;

        //**************************
        //Description : Return the speed of the entity
        //Parameters : References on the speed of the abscissa and the ordinary
        //Return Value : None
        //Note : None
        //**************************
        void GetSpeed(int & _iSpeedX, int & _iSpeedY) const;

        //**************************
        //Description :Set the speed of the entity on the abscissa
        //Parameters : New values of m_iSpeedX
        //Return Value : None
        //Note : None
        //**************************
        void SetSpeedX(int _iSpeedX);

        //**************************
        //Description :Set the speed of the entity on the ordinary
        //Parameters : New values of m_iSpeedX
        //Return Value : None
        //Note : None
        //**************************
        void SetSpeedY(int _iSpeedY);

        //**************************
        //Description : Set the speed of the entity
        //Parameters : New values of m_iSpeedX and m_iSpeedY
        //Return Value : None
        //Note : None
        //**************************
        void SetSpeed(int _iSpeedX, int _iSpeedY);

        //**************************
        //Description : Return wheter the entity is out of the screen or not
        //Parameters : None
        //Return Value : True if the entity is out of the screen, otherwise false
        //Note : None
        //**************************
        virtual bool IsOutOfScreen() const;

        //**************************
        //Description : Return wheter the entity is in the screen or not
        //Parameters : None
        //Return Value : True if the entity is in the the screen, otherwise false
        //Note : We return true if the entity is COMPLETELY in the screen, not partially
        //**************************
        bool IsInTheScreen() const;

        //**************************
        //Description : Return wheter the entity is out of the screen or not
        //Parameters : A pointer on an IDefaultEntityBehaviour
        //Return Value : True if the entity is out of the screen, otherwise false
        //Note : Static function because we use it as a predicate
        //**************************
        static bool EntityOutOfScreen(IDefaultEntityBehaviour * _entity);

};

#endif
